package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the SKILL database table.
 * 
 */
@Entity
@NamedQuery(name="Skill.findAll", query="SELECT s FROM Skill s")
public class Skill implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="SKILL_SKILLID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SKILL_SKILLID_GENERATOR")
	@Column(name="SKILL_ID")
	private long skillId;

	@Column(name="SKILL_CREATORDATE")
	private Timestamp skillCreatordate;

	@Column(name="SKILL_NAME")
	private String skillName;

	@Column(name="SKILL_PERSON")
	private String skillPerson;

	@Column(name="SKILL_REMARK")
	private String skillRemark;

	@Column(name="SKILL_UPDATEDATE")
	private Timestamp skillUpdatedate;

	//bi-directional many-to-one association to AuxiliaryInformation
	@OneToMany(mappedBy="skill")
	@JSONField(serialize=false)
	private List<AuxiliaryInformation> auxiliaryInformations;

	public Skill() {
	}

	public long getSkillId() {
		return this.skillId;
	}

	public void setSkillId(long skillId) {
		this.skillId = skillId;
	}

	public Timestamp getSkillCreatordate() {
		return this.skillCreatordate;
	}

	public void setSkillCreatordate(Timestamp skillCreatordate) {
		this.skillCreatordate = skillCreatordate;
	}

	public String getSkillName() {
		return this.skillName;
	}

	public void setSkillName(String skillName) {
		this.skillName = skillName;
	}

	public String getSkillPerson() {
		return this.skillPerson;
	}

	public void setSkillPerson(String skillPerson) {
		this.skillPerson = skillPerson;
	}

	public String getSkillRemark() {
		return this.skillRemark;
	}

	public void setSkillRemark(String skillRemark) {
		this.skillRemark = skillRemark;
	}

	public Timestamp getSkillUpdatedate() {
		return this.skillUpdatedate;
	}

	public void setSkillUpdatedate(Timestamp skillUpdatedate) {
		this.skillUpdatedate = skillUpdatedate;
	}

	public List<AuxiliaryInformation> getAuxiliaryInformations() {
		return this.auxiliaryInformations;
	}

	public void setAuxiliaryInformations(List<AuxiliaryInformation> auxiliaryInformations) {
		this.auxiliaryInformations = auxiliaryInformations;
	}

	public AuxiliaryInformation addAuxiliaryInformation(AuxiliaryInformation auxiliaryInformation) {
		getAuxiliaryInformations().add(auxiliaryInformation);
		auxiliaryInformation.setSkill(this);

		return auxiliaryInformation;
	}

	public AuxiliaryInformation removeAuxiliaryInformation(AuxiliaryInformation auxiliaryInformation) {
		getAuxiliaryInformations().remove(auxiliaryInformation);
		auxiliaryInformation.setSkill(null);

		return auxiliaryInformation;
	}

}